package group2assignone.ucm.customer;

import group2assignone.ucm.UCController;
import group2assignone.view.MainView;
import group2assignone.view.OurView;

/**
 * Use Case: Cancel Guest 
 * Pre-condition: Guest clicks the cancel button from an avaiable view.
 * Post-condition: Main menu is displayed.
 * 1. system creates the new main view
 * 2. system opens the new main view
 * 3. system exits the current view
 * @author group2
 */
public class UCCancelGuest implements UCController {

    private OurView view;

    /**
     * Gets the view that needs to be cancelled.
     * @param view
     */
    public UCCancelGuest(OurView view) {
        this.view = view;
    }

    /**
     * Takes the guest back to the main welcome view
     */
    public void run() {
        MainView gui = new MainView(); 
        // 1. system creates the new main view
        gui.go();       // 2. system opens the new main view
        view.dispose(); // 3. system exits the current view
    }
}
